package robosym.visual.emulator;

import robosym.visual.Analyzer;
import robosym.visual.Barrier;

/**
 * @author TR
 */
public class AnalyzerEmulator implements Analyzer{
    
    public static float FOVRAD = (float)Math.PI / 3f;
    public static float DISTANCE = 500;
    
    protected float x;
    protected float y;
    protected float angleRad;

    public AnalyzerEmulator(float x, float y, float angleRad) {
        setPosition(x, y, angleRad);
    }

    public AnalyzerEmulator() {
    }

    public void setPosition(float x, float y, float angleRad) {
        this.x = x;
        this.y = y;
        this.angleRad = angleRad;
    }
    
    Map map = Map.getInstance();
    
    public Barrier[] getSightBarriers() {
        return map.getBarriersByFilter(
                x,
                y, 
                angleRad+(FOVRAD/2), 
                angleRad-(FOVRAD/2), 
                DISTANCE);
    }
    
}
